﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.ObjectModel;
using System.Windows.Input;
using LegtionMVVM;

namespace Test.ViewModels
{
    public class LegtionMVVMDemoVM:LegtionMVVM.NotifyPropertyChanged
    {
        #region properties
        public virtual ObservableCollection<Models.User> Users { get; set; }
        public virtual string LoginUserName { get; set; }
        public virtual Models.User CurrentLoginUser { get; set; }
        #endregion
 
        public LegtionMVVMDemoVM()
        {
            LoginUserName = "Hi boy";
            Users = new ObservableCollection<Models.User>();
            Users.Add(new Models.User { Id = 1, Name = "Tom", Address = "sz,GD,China" });
            CurrentLoginUser = Users[0];
            CurrentLoginUser.Oder = new Models.Oders { Id=1,Total=(decimal)189.32};
            var vvv = SetPropertyValueCommand;
        
        }

        #region commandes
        private ICommand _setPropertyValueCommand;

        public ICommand SetPropertyValueCommand
        {
            get
            {
                if (_setPropertyValueCommand == null)
                    _setPropertyValueCommand = new RelayCommand(SetPropertyValue);
                return _setPropertyValueCommand;
            }
        }

        private void SetPropertyValue()
        {
        }
        #endregion
    }
}
